package g14.sc12project.milestone1.client;

import g14.sc12project.milestone1.client.G14WeatherStub.Date;
import g14.sc12project.milestone1.client.G14WeatherStub.QueryWeahter;
import g14.sc12project.milestone1.client.G14WeatherStub.QueryWeahterResponse;
import g14.sc12project.milestone1.client.G14WeatherStub.WeatherInfo;

import g14.sc12project.milestone1.client.G14WarehouseStub.Query;
import g14.sc12project.milestone1.client.G14WarehouseStub.QueryResponse;

import g14.sc12project.milestone1.client.G14WarehouseStub.ComplementStock;
import g14.sc12project.milestone1.client.G14WarehouseStub.ComplementStockResponse;

import g14.sc12project.milestone1.client.G14BookCategoryStub.GetAllBooKNames;
import g14.sc12project.milestone1.client.G14BookCategoryStub.GetAllBooKNamesResponse;



import java.rmi.RemoteException;

public class TestClient {

public static void main(String[] args) throws RemoteException {
		
		//Test Warehouse Service
		
		G14WarehouseStub wstub=new G14WarehouseStub();
		
		Query q= new Query();
		q.setResourceID("residone");
		QueryResponse qres=wstub.query(q);
		System.out.println(qres.get_return());
		
		ComplementStock cs= new ComplementStock();
		cs.setResourceID("residone");
		cs.setAmount(2);
		ComplementStockResponse csres=wstub.complementStock(cs);
		System.out.println(csres.get_return());
		
		//Test Book Store
		G14BookCategoryStub bsstub=new G14BookCategoryStub();
		
		GetAllBooKNames bn= new GetAllBooKNames();
		
		GetAllBooKNamesResponse bsres=bsstub.getAllBooKNames(bn);
		
		String[] bookNames = bsres.get_return();
		for(int count=0; count<bookNames.length; count++){
			System.out.println(bookNames[count]);
		}
		
		/*
		//Test Weather Service
		G14WeatherStub stub=new G14WeatherStub();
		QueryWeahter qw=new QueryWeahter();
		Date dt=new Date();
		dt.setYear(2012);
		dt.setMonth(12);
		dt.setDate(11);
		qw.setDate(dt);
		qw.setLocation("Munich");
		
		QueryWeahterResponse res = stub.queryWeahter(qw);
		
		
		WeatherInfo wi = res.get_return();
		*/
		
		

	}

}
